// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import FastClick from 'fastclick'
import VueRouter from 'vue-router'
import App from './App'
import Home from './components/Home'

import moment from 'moment'

Vue.filter('momentFormat', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
    var weekLabel = ['周日','周一','周二','周三','周四','周五','周六'];
    return moment(dataStr).format(pattern) + '（' + weekLabel[moment(dataStr).day()] + '）';
});

Vue.filter('ymdFormat', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
  var weekLabel = ['周日','周一','周二','周三','周四','周五','周六'];
  return moment(dataStr).format(pattern);
});

Vue.use(VueRouter)

const routes = [{
  path: '/',
  component: Home
}]

const router = new VueRouter({
  routes
})

FastClick.attach(document.body)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  router,
  render: h => h(App)
}).$mount('#app-box')
